// 购物车块接口
import httpRequest from '@/common/request/index.js';
const _request = new httpRequest();

/**
 * @description 购物车信息增加
 */
export function shoppingCartModify(data) {
    return _request.post('/item/shoppingCart/modify', data)
}

/**
 * @description 购物车列表
 */
export function shoppingCart(data) {
    return _request.get('/item/shoppingCart', data)
}

/**
 * @description 收货地址列表
 */
export function addressLists(data) {
    return _request.post('/address/list', data)
}

/**
 * @description 地址详情
 */
export function addressInfo(data) {
    return _request.get('/address/info', data)
}

/**
 * @description 新增地址
 */
export function addressAdd(data) {
    return _request.post('/address/add', data)
}

/**
 * @description 修改地址信息
 */
export function addressModify(data) {
    return _request.post('/address/modify', data)
}

/**
 * @description 删除地址
 */
export function addressDelete(data) {
    return _request.post('/address/delete', data)
}

/**
 * @description 获取默认地址
 */
export function addressDefault(data) {
    return _request.get('/address/info/default', data)
}

/**
 * @description 计算支付金额
 */
export function calculate(data) {
    return _request.post('/order/amount/calculate', data)
}

/**
 * @description 下单前check-用户端
 */
export function preCheck(data) {
    return _request.post('/order/create/preCheck', data)
}

/**
 * @description 创建订单
 */
export function orderCreate(data) {
    return _request.post('/order/create', data)
}

/**
 * @description 删除购物车数据
 */
export function batchDelete(data) {
    return _request.post('/item/batch/delete', data)
}


/**
 * @description 支付
 */
export function payUnifiedOrder(data) {
    return _request.post('/pay/unifiedOrder', data)
}


/**
 * @description vip支付接口
 */
export function payVipUnifiedOrder(data) {
    return _request.post('/pay/vip/unifiedOrder', data)
}
